﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace Home.Converters
{
    public class StepColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int currentStep = (int)value;

            
            int stepIndex = 0;
            if (parameter != null && int.TryParse(parameter.ToString(), out stepIndex))
            {
               
                return currentStep >= stepIndex ? "#5B8DEF" : Brushes.Gray;
            }
            else
            {
                return Brushes.Gray;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }
    }
}
